<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"  
		xmlns:h="http://java.sun.com/jsf/html"  
		xmlns:f="http://java.sun.com/jsf/core"
		xmlns:ui="http://java.sun.com/jsf/facelets"
		xmlns:c="http://java.sun.com/jsp/jstl/core">  
    
    <ui:composition template="#{helperNavigation.getPathTemplate('member')}">
        <ui:define name="pageTitle">Résumé de votre commande</ui:define>
        <ui:define name="mainTitle">Résumé de votre commande</ui:define>
        <ui:define name="mainContent">
            <c:if test="#{cartSession.invoices == null || cartSession.invoices.isEmpty()}">
                <div class="alert alert-info div-info"><h4>Votre panier est vide, vous ne pouvez pas commander.</h4></div>
            </c:if>
            <c:if test="#{cartSession.invoices != null}">
                <c:if test="#{!cartSession.invoices.isEmpty()}">
                    <ui:include src="subContents/resumeOrders.xhtml"></ui:include>
                    
                    <hr />
                    <div class="well center">
                        <h2 class="center">Paiement :</h2><br />
                        <br />
                        <div class="div-info alert alert-info">
                            Le prix total de votre commande est de: <span class="b white large i">#{cartSession.totalPrice} €</span>
                        </div>
                        <br />
                        
                        
                        <h:form id="formPayment" class="form-inline">
                            
                            <h3>Numéro de carte bleue :</h3>
                            <div class="input-prepend input-append">
                                <span class="add-on white"># CB</span>
                                <h:inputText id="userCreditCard" value="#{orderManager.creditCard}" class="validate[required, custom[onlyNumberSp, creditCard]" />
                              </div>

                            <h:commandButton value="Valider" class="btn btn-primary" action="#{orderManager.validateOrder()}" />
                        </h:form>
                    </div>
                    <script type="text/javascript">
                        $j(function(){
                            var form = "#formPayment";

                            // Load validationEngine for check in real time the user entries.
                            $j(form).validationEngine('attach');
                        });
                    </script>
                </c:if>
            </c:if>
        </ui:define>
    </ui:composition>
</html>

